WT_DECLARE_WT_MEMBER(1,JavaScriptConstructor,"WAxisSliderWidget",function(y,e,m,f){function C(a){return a.pointerType===2||a.pointerType===3||a.pointerType==="pen"||a.pointerType==="touch"}function I(){M(m.repaint)}function J(){var a=f.transform[4]/f.drawArea[2];return[a,f.transform[0]+a]}function p(a){I();if(a){a=f.transform;var b=a[4]/f.drawArea[2];f.chart.setXRange(f.series,b,a[0]+b,f.updateYAxis)}}function r(){return!f.chart.config.isHorizontal}function D(a,b,c){return r()?a.y>=t(b)&&a.y<=u(b)&&
a.x>v(b)-c/2&&a.x<v(b)+c/2:a.x>=v(b)&&a.x<=w(b)&&a.y>t(b)-c/2&&a.y<t(b)+c/2}function E(a,b,c){return r()?a.y>=t(b)&&a.y<=u(b)&&a.x>w(b)-c/2&&a.x<w(b)+c/2:a.x>=v(b)&&a.x<=w(b)&&a.y>u(b)-c/2&&a.y<u(b)+c/2}function z(a,b){return r()?a.y>=t(b)&&a.y<=u(b)&&a.x>v(b)&&a.x<w(b):a.x>=v(b)&&a.x<=w(b)&&a.y>t(b)&&a.y<u(b)}function F(a){var b=f.transform,c=f.drawArea,d=b[4]/c[2];b=b[0]+d;a=(d*c[2]+a)/c[2];if(!(b<=a))if(!(1/(b-a)>f.chart.config.maxZoom[0])){if(a<0)a=0;if(a>1)a=1;n.changeRange(a,b);p(true);a=J();
if(Math.abs(a[1]-b)>Math.abs(a[0]-d)){n.changeRange(d,b);p(true)}}}function G(a){var b=f.transform,c=f.drawArea,d=b[4]/c[2];b=b[0]+d;a=(b*c[2]+a)/c[2];if(!(a<=d))if(!(1/(a-d)>f.chart.config.maxZoom[0])){if(a<0)a=0;if(a>1)a=1;n.changeRange(d,a);p(true);a=J();if(Math.abs(a[0]-d)>Math.abs(a[1]-b)){n.changeRange(d,b);p(true)}}}function K(a){var b=f.transform,c=f.drawArea,d=b[4]/c[2];b=b[0]+d;d=d*c[2];var g=d+a;if(g<0){a=-d;g=0}g=g/c[2];b=b*c[2];a=b+a;if(a>c[2]){a=c[2]-b;g=d+a;g=g/c[2];a=c[2]}n.changeRange(g,
a/c[2]);p(true)}var N=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,0)}}(),H=false,M=function(a){if(!H){H=true;N(function(){a();H=false})}},o={};jQuery.data(e,"sobj",this);var n=this,h=y.WT;m.canvas.style.msTouchAction="none";var q=false;if(window.MSPointerEvent||window.PointerEvent){e.style.touchAction="none";m.canvas.style.msTouchAction="none";m.canvas.style.touchAction="none"}if(window.MSPointerEvent||
window.PointerEvent)(function(){function a(){if(pointers.length>0&&!q)q=true;else if(pointers.length<=0&&q)q=false}function b(k){if(C(k)){k.preventDefault();pointers.push(k);a();o.start(e,{touches:pointers.slice(0)})}}function c(k){if(q)if(C(k)){k.preventDefault();var l;for(l=0;l<pointers.length;++l)if(pointers[l].pointerId===k.pointerId){pointers.splice(l,1);break}a();o.end(e,{touches:pointers.slice(0),changedTouches:[]})}}function d(k){if(C(k)){k.preventDefault();var l;for(l=0;l<pointers.length;++l)if(pointers[l].pointerId===
k.pointerId){pointers[l]=k;break}a();o.moved(e,{touches:pointers.slice(0)})}}pointers=[];var g=jQuery.data(e,"eobj");if(g)if(window.PointerEvent){e.removeEventListener("pointerdown",g.pointerDown);e.removeEventListener("pointerup",g.pointerUp);e.removeEventListener("pointerout",g.pointerUp);e.removeEventListener("pointermove",g.pointerMove)}else{e.removeEventListener("MSPointerDown",g.pointerDown);e.removeEventListener("MSPointerUp",g.pointerUp);e.removeEventListener("MSPointerOut",g.pointerUp);e.removeEventListener("MSPointerMove",
g.pointerMove)}jQuery.data(e,"eobj",{pointerDown:b,pointerUp:c,pointerMove:d});if(window.PointerEvent){e.addEventListener("pointerdown",b);e.addEventListener("pointerup",c);e.addEventListener("pointerout",c);e.addEventListener("pointermove",d)}else{e.addEventListener("MSPointerDown",b);e.addEventListener("MSPointerUp",c);e.addEventListener("MSPointerOut",c);e.addEventListener("MSPointerMove",d)}})();var v=h.gfxUtils.rect_left,w=h.gfxUtils.rect_right,t=h.gfxUtils.rect_top,u=h.gfxUtils.rect_bottom,
i=null,j=null;this.changeRange=function(a,b){if(a<0)a=0;if(b>1)b=1;var c=f.drawArea;f.transform[0]=b-a;f.transform[4]=a*c[2];I()};this.mouseDown=function(a,b){if(!q){i=h.widgetCoordinates(e,b);a=f.rect();if(D(i,a,10))j=1;else if(E(i,a,10))j=3;else if(z(i,a))j=2;else{j=null;return}h.cancelEvent(b)}};this.mouseUp=function(a,b){if(!q){i=null;if(j!==null){j=null;h.cancelEvent(b)}}};this.mouseDrag=function(a,b){if(!q)if(j){h.cancelEvent(b);a=h.widgetCoordinates(e,b);if(i===null)i=a;else{b=r()?a.x-i.x:
a.y-i.y;switch(j){case 1:F(b);break;case 2:K(b);break;case 3:G(b);break}i=a;p(true)}}};this.mouseMoved=function(a,b){setTimeout(function(){if(!q)if(!j){var c=h.widgetCoordinates(e,b),d=f.rect();m.canvas.style.cursor=D(c,d,10)||E(c,d,10)?r()?"col-resize":"row-resize":z(c,d)?"move":"auto"}},0)};var x=false,s=false,A=null;o.start=function(a,b){x=b.touches.length===1;s=b.touches.length===2;if(x){i=h.widgetCoordinates(m.canvas,b.touches[0]);a=f.rect();if(D(i,a,20))j=1;else if(E(i,a,20))j=3;else if(z(i,
a))j=2;else{j=null;return}h.capture(null);h.capture(m.canvas);b.preventDefault&&b.preventDefault()}else if(s){j=null;var c=[h.widgetCoordinates(m.canvas,b.touches[0]),h.widgetCoordinates(m.canvas,b.touches[1])];a=f.rect();if(z(c[0],a)&&z(c[1],a)){A=r()?Math.abs(c[0].x-c[1].x):Math.abs(c[0].y-c[1].y);h.capture(null);h.capture(m.canvas);b.preventDefault&&b.preventDefault()}}};o.end=function(a,b){var c=Array.prototype.slice.call(b.touches);a=x;var d=s,g=c.length===0;x=c.length===1;s=c.length===2;g||
function(){var k;for(k=0;k<b.changedTouches.length;++k)(function(){for(var l=b.changedTouches[k].identifier,B=0;B<c.length;++B)if(c[B].identifier===l){c.splice(B,1);return}})()}();g=c.length===0;x=c.length===1;s=c.length===2;if(g&&a){i=null;if(j===null)return;j=null;h.cancelEvent(b)}if(x&&d){s=false;A=null;h.cancelEvent(b);o.start(e,b)}if(g&&d){s=false;A=null;h.cancelEvent(b)}};o.moved=function(a,b){if(j){b.preventDefault&&b.preventDefault();a=h.widgetCoordinates(e,b);if(i===null)i=a;else{b=r()?a.x-
i.x:a.y-i.y;switch(j){case 1:F(b);break;case 2:K(b);break;case 3:G(b);break}i=a;p(true)}}else if(s){b.preventDefault&&b.preventDefault();touches=[h.widgetCoordinates(m.canvas,b.touches[0]),h.widgetCoordinates(m.canvas,b.touches[1])];f.rect();a=r()?Math.abs(touches[0].x-touches[1].x):Math.abs(touches[0].y-touches[1].y);b=a-A;F(-b/2);G(b/2);A=a;p(true)}};this.updateConfig=function(a){for(var b in a)if(a.hasOwnProperty(b))f[b]=a[b];p(false)};n.updateConfig({});if(window.TouchEvent&&!window.MSPointerEvent&&
!window.PointerEvent){n.touchStarted=o.start;n.touchEnded=o.end;n.touchMoved=o.moved}else{y=function(){};n.touchStarted=y;n.touchEnded=y;n.touchMoved=y}});
